var fs = require('fs')

function route(handle,res,pathname,params){
    if(typeof handle[pathname] === 'function'){
        handle[pathname](res,params);
    }else{
        res.writeHead(200,{'content-type':'text/html'})
        fs.createReadStream(__dirname+'/404.html').pipe(res)
    }
}
module.exports = route